home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / noghst / noghost.frm < prev    next >
Text File  |  1995-05-08  |  4KB  |  114 lines

  1. VERSION 2.00
  2. Begin Form MainForm 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "NoGhost TestApp"
  5.    ClientHeight    =   3930
  6.    ClientLeft      =   1020
  7.    ClientTop       =   1710
  8.    ClientWidth     =   7350
  9.    Height          =   4620
  10.    Icon            =   NOGHOST.FRX:0000
  11.    Left            =   960
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   3930
  14.    ScaleWidth      =   7350
  15.    Top             =   1080
  16.    Width           =   7470
  17.    Begin Label Label1 
  18.       AutoSize        =   -1  'True
  19.       BackColor       =   &H00C0C0C0&
  20.       Height          =   195
  21.       Left            =   120
  22.       TabIndex        =   0
  23.       Top             =   120
  24.       Width           =   7095
  25.       WordWrap        =   -1  'True
  26.    End
  27.    Begin Menu FileMenu 
  28.       Caption         =   "&File"
  29.       Begin Menu ExitChoice 
  30.          Caption         =   "E&xit"
  31.       End
  32.    End
  33.    Begin Menu ConfigureMenu 
  34.       Caption         =   "&Configuration"
  35.       Begin Menu EnableChoice 
  36.          Caption         =   "&Enable Processing"
  37.          Checked         =   -1  'True
  38.       End
  39.       Begin Menu SizingOption 
  40.          Caption         =   "&Sizeable"
  41.          Checked         =   -1  'True
  42.       End
  43.    End
  44. End
  45. DefInt A-Z
  46.  
  47. Declare Function RegNoGhost Lib "noghost.dll" (ByVal hWnd%, ByVal AllowSizing%, ByVal OnOff%) As Integer
  48.  
  49. Const lblMult = .9
  50. Dim lblString$
  51.  
  52. Sub EnableChoice_Click ()
  53.     
  54.     EnableChoice.Checked = Not (EnableChoice.Checked)
  55.     If EnableChoice.Checked Then
  56.         ErrCode = RegNoGhost(MainForm.hWnd, True, False)
  57.         ErrCode = RegNoGhost(MainForm.hWnd, SizingOption.Checked, True)
  58.     Else
  59.         ErrCode = RegNoGhost(MainForm.hWnd, SizingOption.Checked, False)
  60.     End If
  61.     
  62. End Sub
  63.  
  64. Sub ExitChoice_Click ()
  65.  
  66.     ErrCode = RegNoGhost(MainForm.hWnd, True, False)
  67.     Unload MainForm
  68.     
  69. End Sub
  70.  
  71. Sub Form_Load ()
  72.  
  73.     lblString$ = "NoGhost is a tool which allows Visual Basic applications to respond to Cascade and Tile messages properly.  It also behaves properly when the Visual Basic application is minimized and does not detract from the Cascading or Tiling of other applications.  NoGhost is programmer configurable to allow or disallow sizing of the Visual Basic application's window.  "
  74.     lblString$ = lblString$ + "Try this sample program to get an idea how the control works.  Turning off the Enable Processing option will show you how Visual Basic applications normally behave.  "
  75.     lblString$ = lblString$ + "NoGhost only requires 5K of memory and one simple call to a DLL function."
  76.     lblString$ = lblString$ + Chr$(13) + Chr$(10) + Chr$(13) + Chr$(10) + "By Greg Blaum - CIS: 71212,1763"
  77.     lblString$ = lblString$ + Chr$(13) + Chr$(10) + "Copyright 1993"
  78.     lblString$ = lblString$ + Chr$(13) + Chr$(10) + "NoGhost is FREEWARE, suggestions or questions are welcome"
  79.     ErrCode = RegNoGhost(MainForm.hWnd, True, True)
  80.     Label1.Caption = lblString$
  81.     Label1.Refresh
  82.  
  83. End Sub
  84.  
  85. Sub Form_Resize ()
  86.  
  87.     If WindowState <> 1 Then
  88.         Label1.Visible = False
  89.         Label1.Width = lblMult * MainForm.Width
  90.         Label1.Refresh
  91.         Label1.Visible = True
  92.     End If
  93.  
  94. End Sub
  95.  
  96. Sub Form_Unload (Cancel As Integer)
  97.  
  98.     ErrCode = RegNoGhost(MainForm.hWnd, True, False)
  99.  
  100. End Sub
  101.  
  102. Sub SizingOption_Click ()
  103.     
  104.     SizingOption.Checked = Not (SizingOption.Checked)
  105.     If EnableChoice.Checked Then
  106.         ErrCode = RegNoGhost(MainForm.hWnd, True, False)
  107.         ErrCode = RegNoGhost(MainForm.hWnd, SizingOption.Checked, True)
  108.     Else
  109.         ErrCode = RegNoGhost(MainForm.hWnd, SizingOption.Checked, False)
  110.     End If
  111.     
  112. End Sub
  113.  
  114.